home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / c / library / dos / communic / pcmail / main / default.ins < prev    next >
Encoding:
Text File  |  1994-06-05  |  11.5 KB  |  269 lines

  1. @(#) DEFAULT.ins 2.1 90/01/22 13:01:05
  2.  
  3. This document briefly describes how to set up  a  PC-mail  system
  4. that uses the default PC-mail UUCP software to exchange mail with
  5. its UNIX host. The examples given apply to `old' UNIX UUCP;  your
  6. file names and formats may vary.
  7.  
  8. THE UNIX SIDE OF THE CONNECTION
  9.  
  10. The PC-mail programs will need a UNIX host to  exchange  messages
  11. with.  This  automatically gives access to other networks. I sug-
  12. gest the following strategy:
  13.  
  14.  - Get a UUCP login, say, `uuxyz' on a  UNIX  system.  This  will
  15. also  become  the  UUCP-node  name of the PC. Sometimes, the UNIX
  16. UUCP software will refuse  to  work  with  arbitrary  (uid,  gid)
  17. values; during the initial handshake messages, it will reply with
  18. RLOGIN instead of ROK. On these systems, the (uid, gid) values of
  19. your  UUCP  login  should be small numbers, probably in the range
  20. 1-100.
  21.  
  22. The UUCP systems file (/usr/lib/uucp/L.sys)  should  be  extended
  23. with an entry for the `uuxyz' host, e.g.
  24.  
  25.     uuxyz Passive
  26.  
  27. On some systems one has to specify `Never' instead of  `Passive'.
  28. It  may  also  be  necessary  to update the UUCP permissions file
  29. (/usr/lib/uucp/USERFILE).
  30.  
  31.  - Have all mail for user `uuxyz' forwarded to  `uuxyz!somebody'.
  32. With Berkeley UNIX, this can be achieved by placing  the  address
  33. `uuxyz!somebody'  in the file ~uuxyz/.forward; with System-V UNIX
  34. one may have to put the text `Forward to uuxyz!somebody'  in  the
  35. file  /usr/mail/uuxyz,  which  should  be read/writeable by group
  36. mail. Alternatively, you can ask the UNIX system administrator to
  37. define  an  alias  that  maps  `uuxyz' to `uuxyz!somebody' if the
  38. local mailer supports aliases.
  39.  
  40. In the above examples, `somebody' is a name that  can  be  freely
  41. chosen;  it  will  not  be used by the PC. Of course, mail can be
  42. forwarded to `uuxyz!somebody' from other accounts as well.
  43.  
  44. The result of all this is that you can send mail to any  user  on
  45. the  UNIX  host by just specifying her login name; your mail will
  46. appear to come from the user `uuxyz' on the UNIX host. The  UUCP-
  47. node  name of your PC will not appear in mail headers. People can
  48. send mail to you by specifying `uuxyz' on the  UNIX  host.  Since
  49. the  host name of the PC does not appear in mail headers there is
  50. no need to register the PC in, e.g., the UUCP maps.
  51.  
  52. As a minimum, the UNIX host should support the standard UUCP  `g'
  53. protocol.  This  protocol  was developed for eight-bit data paths
  54. across  dial-up  links  (modems).  Unfortunately,  more  advanced
  55. networks eat up XON/XOFF and other control characters. This  must
  56. be the price of progress.
  57.  
  58. To handle  non-transparent  networks  I  have  written  a  simple
  59. start/stop  `k'  protocol.  It  has  been in use on the Eindhoven
  60. University Sytek network since 1986 and is part  of  the  PC-mail
  61. distribution.  If  you're really desperate (and have UNIX source)
  62. build this  protocol  into  the  uucico  program  by  adding  the
  63. following line to struct Proto Ptbl[] in the file cntrl.c:
  64.  
  65.     'k', kturnon, krdmsg, kwrmsg, krddata, kwrdata, kturnoff,
  66.  
  67. and linking the uucico objects with kio.c  kp.h  kphys.c  kpres.c
  68. and ktrans.c.
  69.  
  70. THE PC SIDE OF THE CONNECTION
  71.  
  72. A warning for MS-DOS users: TSR programs may interfere  with  the
  73. operation of the dial-up and file transfer program.
  74.  
  75. To up bring PC-mail, copy the appropriate makefile.whatever  file
  76. to  makefile  and  edit it (there are template makefiles for UNIX
  77. and MS-DOS).  The MS-DOS makefile is for a  UNIX-compatible  make
  78. utility  posted  to usenet near the end of 1986. There is a batch
  79. command file (DEFAULT.bat) for those who  do  not  have  a  unix-
  80. compatible make utility. The make  utility  provided  with  early
  81. releases of MicroSoft C is definitely not UNIX compatible.
  82.  
  83. Saying `make' should produce five programs:
  84.  
  85.  - mail, the menu-driven user interface
  86.  - cmail, a program that checks if there is new mail
  87.  - smail, a program that queues messages for  transmission  after
  88.           doing alias substitution on mail addresses
  89.  - nmail, extracts "From" and "Subject" info from new mail
  90.  - cico, the program that performs dialups and file transfers
  91.  
  92. Under MS-DOS, the cico program has to be compiled with the  small
  93. memory  model; in order to handle mail messages larger than about
  94. 10 kbyte, the mail user interface program should be compiled with
  95. the large memory model.
  96.  
  97. The programs access a common data base in the  form  of  a  spool
  98. directory with setup file, logfile and message files.  Optionally
  99. there may be  header  and  trailer  files  to  generate  template
  100. messages.  There should be no other files in the spool directory,
  101. to avoid confusion. The spool  directory  should  be  created  by
  102. hand; the PC-mail programs will not do that.
  103.  
  104. You will have to set some environment  variables  before  running
  105. the mail program.
  106.  
  107.  - MAILDIR, the location of your mail data base directory
  108.  - EDITOR, the name of your favourite editor program
  109.  - PATH, in order locate the PC-mail executables, and your editor
  110.  
  111. It is advised to use absolute path names that include  the  drive
  112. name.  The  editor  command  may be an MS-DOS batch file; in that
  113. case you should include the '.bat' suffix in the command name.
  114.  
  115. The following two environment variables are optional.
  116.  
  117.  - MAILPRN, the name of a file, if printer output should not go to 
  118.     the default printer.
  119.  - MAILCMD, a command that is executed  on  exit  from  the  mail
  120.         program. If this is an MS-DOS batch file you should include
  121.     the '.bat' suffix in the command name.
  122.  
  123. At our site, these two variables  are  used  to  collect  printer
  124. output  in  one  file, and to send it to a networked printer upon
  125. exit from the program.
  126.  
  127. Make sure that the limit on the number of  open  files  is  large
  128. enough  (20  or  so).  On  MS-DOS, this is handled by a line with
  129. `files=20' in the CONFIG.SYS file.
  130.  
  131. On MS-DOS, the mail user interface requires the ANSI.SYS  driver.
  132. The CONFIG.SYS file should specify a line with "device=ansi.sys".
  133.  
  134. Run the interactive mail program and choose  the  setup  command.
  135.  
  136. All entries must be filled or the cico program (for  dial-up  and
  137. file  transfer)  will  complain. On MS-DOS systems, only the com1
  138. port is supported (see the file comport.asm). I am not interested
  139. in  80*86  assembly-language programming; you will have hack your
  140. own com2 support.
  141.  
  142. The first item in the setup is not used by the dial-up and  file-
  143. transfer program.
  144.  
  145. Here  is  my  setup  (some names changed) for getting through the
  146. horrible port selector of our local university network (it  needs
  147. to  receive  up  to  nine carriage returns in order to detect the
  148. baud rate of a dial-up call, can you believe it):
  149.  
  150.     ignore_header_lines: received message-id
  151.     communications_port: com1
  152.     baud_rate:           2400
  153.     remote_host_name:    eutwc1
  154.     login_name:          uutest
  155.     dialup_sequence:     atz\r OK atdt0,455215\r CONNECT \r \0 \r \0 \r 
  156.     \0 \r \0 \0 \r \0 \r \0 \r \0 \r \0 \r \0 \r ease: abc\r ease: def\r 
  157.     hoice:-\0-hoice: 1\r lled: b076\r CLOSED \r
  158.     disconnect_sequence: \0
  159.  
  160. The dial-up sequence requires some explanation. Basically it is a
  161. list of words separated by whitespace:
  162.  
  163.     send1 expect1 send2 expect2 (and so on)
  164.  
  165. The first word is sent to the comm. port. The program  will  wait
  166. until  it receives the second word. Then it sends the third word.
  167. And so on. There is a retry facility, similar to the one in  real
  168. UUCP or later versions of Kermit, that works as follows:  instead
  169. of an expect string you can  specify  an  alternate  sequence  as
  170. words separated by hyphen characters:
  171.  
  172.     expect-altsend1-altexpect1-altsend2-altexpect2 (and so on)
  173.  
  174. If the "expect" string  is  not  received,  the  first  alternate
  175. "send"  string  is  sent, and the program waits until it receives
  176. the first alternate "expect" string. If that  fails,  the  second
  177. alternate "send" string is sent and so on. The alternate sequence
  178. is terminated until an (alternate) expect succeeds or  until  the
  179. alternate sequence is exhausted, or due to time out.
  180.  
  181. Note  that  carriage-return  characters  are  not   automatically
  182. appended  to  "send" strings. In order to specify these and other
  183. control characters in send/expect  strings  I  have  stolen  some
  184. escape sequences from the C programming language, and added some:
  185.  
  186.     \f          formfeed
  187.     \n          linefeed
  188.     \r          carriage return
  189.     \s          blank
  190.     \t          tab
  191.     \\          backslash
  192.     \nnn        octal code for a character
  193.  
  194. In  order to send or expect an empty string, use the \0 sequence.
  195. Empty "send" strings introduce brief delays.  An  empty  "expect"
  196. string always succeeds.
  197.  
  198. The following "send" strings are given special treatment:
  199.  
  200.     BREAK    causes a null character to be sent
  201.     EOT        causes a Control-D character to be sent
  202.  
  203. The dial-up sequence specified in the setup file should terminate
  204. when  the  UNIX host is about to display its "login:" prompt; the
  205. remainder of the dialup sequence  is  wired  into  the  software.
  206. This, and having (PC node name) equal to (UUCP login name) are to
  207. prevent fraud. If You  have  problems  with  this  approach,  you
  208. should edit the file "connect.c".
  209.  
  210. Thus, assuming a Hayes-compatible  modem,  your  dialup  sequence
  211. could be as simple as:
  212.  
  213.     atz\r OK atdt123456\r CONNECT
  214.  
  215. When this dialup sequence succeeds, the  program  continues  with
  216. its built-in sequence:
  217.  
  218.     ogin: your_uucp_login\r ssword: your_uucp_password\r
  219.  
  220. The disconnect sequence uses the same  escape  sequences  as  the
  221. dial-up  sequence,  but does not use the send/expect protocol. In
  222. the example above, the disconnect  sequence  is  a  null  string,
  223. which happens to be the default.
  224.  
  225. In order to test your dial-up  sequence  you  can  run  the  cico
  226. program by hand, for example:
  227.  
  228.     cico -d 9 -p your_uucp_password
  229.  
  230. This  will  produce  a  lot  of  debugging  output.  Setting  the
  231. debugging  level  to  less  than  9 reduces verbosity. Level 4 is
  232. sufficient to monitor the dial-up and login sequence.
  233.  
  234. ALIAS DATABASE
  235.  
  236. The user can define aliases for (groups of) mail  addresses.  The
  237. alias data base is a text file with on each line:
  238.  
  239.     alias replacement_part
  240.  
  241. The alias should be a single word; words are separated by blanks,
  242. tabs  or  commas.  The replacement part may be one or more words.
  243. Whenever the smail (mail spooler) program recognizes an alias, it
  244. is  replaced by the `replacement part'. Aliases may be defined in
  245. terms of other aliases; the order in which  they  appear  in  the
  246. alias data base is not important (except when an alias is defined
  247. more than once; the program remembers only the last definition of
  248. an alias). The alias expansion software is smart enough to detect
  249. infinite loops and to suppress multiple occurrances of  the  same
  250. recipient. Alias substitution is not case-sensitive.
  251.  
  252. BATCH-MODE OPERATION
  253.  
  254. The cmail program can be run from a batch file  (say,  each  time
  255. the  PC is turned on), to contact the UNIX host, and to report if
  256. there is new mail. Also, you may want to auto-execute  the  cmail
  257. command  when  exiting from the interactive mail shell (using the
  258. MAILCMD environment variable described  above).  See  the  manual
  259. page in the cmail.c source.
  260.  
  261. TEMPLATE FILES
  262.  
  263. The user can provide message templates with standard  header  and
  264. trailer  lines.  If  the  file  "header"  is  present in the mail
  265. directory, its contents will be  included  at  the  beginning  of
  266. every  mail  message created by the user. Similarly, the contents
  267. of a file "trailer" will be included at the end of mail messages.
  268. The "header" and "trailer" files should be ordinary text files.
  269.